package com.hawthorn.redis.config;

import com.hawthorn.platform.config.ExecutorConfig;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableAsync;

/**
 * <p>todo 异步任务配置类</p>
 * @author: andyten@tom.com | xukaixing@hotmail.com
 * @created: 2021/11/15 3:43 PM
 * @version v1.0.3
 * @copyright: Copyright (c)  andyten
 */
@Configuration
@EnableAsync
public class AsyncTaskExecutorConfig
{
  @Autowired
  private ExecutorConfig executorConfig;

  /**
   * 配置系统参数存储至redis
   * @return
   */
  @Bean("sysAppConf2RedisExecutor")
  public Object sysAppConf2RedisExecutor()
  {
    return executorConfig.getAsyncExecutor();
  }

  /**
   * 配置业务参数存储至redis
   * @return
   */
  @Bean("sysBizConf2RedisExecutor")
  public Object sysBizConf2RedisExecutor()
  {
    return executorConfig.getAsyncExecutor();
  }

  /**
   * 配置系统用户存储至redis
   * @return
   */
  @Bean("user2RedisExecutor")
  public Object user2RedisExecutor()
  {
    return executorConfig.getAsyncExecutor();
  }

  /**
   * 配置app用户存储至redis
   * @return
   */
  @Bean("appuser2RedisExecutor")
  public Object appuser2RedisExecutor()
  {
    return executorConfig.getAsyncExecutor();
  }

  /**
   * 配置系统字典存储至redis
   * @return
   */
  @Bean("dict2RedisExecutor")
  public Object dict2RedisExecutor()
  {
    return executorConfig.getAsyncExecutor();
  }

  /**
   * 配置系统菜单存储至redis
   * @return
   */
  @Bean("menu2RedisExecutor")
  public Object menu2RedisExecutor()
  {
    return executorConfig.getAsyncExecutor();
  }

  /**
   * 配置行政区划存储至redis
   * @return
   */
  @Bean("division2RedisExecutor")
  public Object division2RedisExecutor()
  {
    return executorConfig.getAsyncExecutor();
  }

  /**
   * 配置系统公司存储至redis
   * @return
   */
  @Bean("company2RedisExecutor")
  public Object company2RedisExecutor()
  {
    return executorConfig.getAsyncExecutor();
  }

  /**
   * 配置系统部门存储至redis
   * @return
   */
  @Bean("dept2RedisExecutor")
  public Object dept2RedisExecutor()
  {
    return executorConfig.getAsyncExecutor();
  }

  /**
   * 配置系统角色存储至redis
   * @return
   */
  @Bean("role2RedisExecutor")
  public Object role2RedisExecutor()
  {
    return executorConfig.getAsyncExecutor();
  }

  /**
   * 配置角色菜单关系存储至redis
   * @return
   */
  @Bean("roleMenu2RedisExecutor")
  public Object roleMenu2RedisExecutor()
  {
    return executorConfig.getAsyncExecutor();
  }

  /**
   * 配置用户角色关系存储至redis
   * @return
   */
  @Bean("userRole2RedisExecutor")
  public Object userRole2RedisExecutor()
  {
    return executorConfig.getAsyncExecutor();
  }
}
